package org.setone.action;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.setone.component.MisAction;
import org.setone.model.User;
import org.setone.service.UserService;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;

public class TestAction extends MisAction {
    @Override
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
        JdbcTemplate jdbcTemplate = getApplicationContext().getBean(JdbcTemplate.class);
        UserService userService = getApplicationContext().getBean(UserService.class);
        User user = userService.queryById(1);
        List<Map<String, Object>> maps = jdbcTemplate.queryForList("SELECT * FROM `hp`.`user` LIMIT 0, 1000");
        List<Map<String, Object>> maps2 = jdbcTemplate.queryForList("SELECT * FROM `hp`.`user` LIMIT 0, 1000");
        return null;
    }
}
